<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
            background: linear-gradient(0deg, #0b74cb 0%, #0b74cb 50%, #fff 50%, #fff 100%);
        }

        .container {
            min-width: 1000px;
            position: relative;
            display: flex;
            justify-content: center;
            flex-wrap: wrap;
            transform-style: preserve-3d;
        }

        .container .card {
            position: relative;
            width: 180px;
            height: 240px;
            background-color: #fff;
            margin: 0 10px;
            display: flex;
            justify-content: center;
            align-items: center;
            border-radius: 4px;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
            overflow: hidden;
            transform-style: preserve-3d;
            transition: transform .5s;
        }

        .container:hover .card {
            transform: perspective(500px) rotateY(30deg);
        }

        .container .card:hover {
            transform: perspective(500px) rotateY(0deg);
        }

        .container .card:hover~.card {
            transform: perspective(500px) rotateY(-30deg);
        }

        .container .card h2 {
            width: 80px;
            height: 80px;
            line-height: 80px;
            font-size: 3em;
            background-color: #2196f3;
            text-align: center;
            border-radius: 50%;
            color: #fff;
            transition: box-shadow .5s;
        }

        .container .card:hover h2 {
            background-color: #fff;
            color: #2196f3;
            box-shadow: 0 0 0 150px #2196ff;
        }
    </style>
</head>

<body>
    <div class="container">
        <div class="card">
            <h2>1</h2>
        </div>
        <div class="card">
            <h2>2</h2>
        </div>
        <div class="card">
            <h2>3</h2>
        </div>
        <div class="card">
            <h2>4</h2>
        </div>
        <div class="card">
            <h2>5</h2>
        </div>
    </div>
</body>

</html>